package day05;

import java.util.Arrays;
import java.util.Scanner;

public class homework {
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);

        int score = 0;
        for (int i = 1;  i<=10; i++){
            //1)出题  2)答题 3)判题
            int guess;
            int num =  (int)(Math.random()*50) ;
            int num_ = (int)(Math.random()*50);
            System.out.println(num + num_);
            guess =scan.nextInt();
            System.out.println();
            if (guess!=num) {
                System.out.println("答错了");
            }else {
                System.out.println("打对了");
                score +=10;

            }
        }
        System.out.println("总分为" + score);

//        Scanner scan = new Scanner(System.in);
//
//        int score = 0;
//        for (int i = 1;  i<=10; i++){
//            //1)出题  2)答题 3)判题
//            int guess;
//            int num =  (int)(Math.random()*50) ;
//            int num_ = (int)(Math.random()*50);
//            System.out.println(num + num_);
//            guess =scan.nextInt();
//            System.out.println();
//            if (guess!=num) {
//                System.out.println("答错了");
//            }else {
//                System.out.println("打对了");
//                score +=10;
//
//            }
//        }
//        System.out.println("总分为" + score);





        for (int num = 1;num<=9;num++){
            for (int i = 1;i<=num;i++){
                System.out.print(i +"*" + num + "=" + i*num+ "\t");
            }
            System.out.println();
        }

//
//        for (int num = 1;num<=9;num++){
//            for (int i = 1;i<=num;i++){
//                System.out.print(i +"*" + num + "=" + i*num+ "\t");
//            }
//            System.out.println();
//        }



        int[] arr = new int[10];
        for (int i = 1;i<arr.length;i++){
            arr[i] = (int)(Math.random()*100);
            System.out.println(arr[i]);

        }
        Arrays.sort(arr);//对arr数组升序排列
        System.out.println("正着排序:");
        for(int i=0;i<arr.length;i++){
            System.out.println(arr[i]);
        }

        System.out.println("倒着排序:");
        for(int i=arr.length-1;i>=0;i--){
            System.out.println(arr[i]);
        }


//
//        int[] arr = new int[10];
//        for (int i = 1;i<arr.length;i++){
//            arr[i] = (int)(Math.random()*100);
//            System.out.println(arr[i]);
//
//        }
//        Arrays.sort(arr);//对arr数组升序排列
//        System.out.println("正着排序:");
//        for(int i=0;i<arr.length;i++){
//            System.out.println(arr[i]);
//        }
//
//        System.out.println("倒着排序:");
//        for(int i=arr.length-1;i>=0;i--){
//            System.out.println(arr[i]);
//        }

    }
}
